package com.zhouyer.study.dao;

import com.zhouyer.study.entity.ZhouyerUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;

/**
 * 用户相关操作DAO
 *
 * @author zhouyao
 * @version 1.0
 * @date 2021/12/7 11:53 上午
 */
public interface UserDao extends JpaRepository<ZhouyerUser, Long> {
    /**
     * 根据邮箱地址查询用户信息
     *
     * @param email 邮箱地址
     * @return com.zhouyer.study.entity.ZhouyerUser
     * @author zhouyao
     */
    ZhouyerUser findByEmail(@Param("email") String email);

    /**
     * 根据令牌查询用户信息
     *
     * @param token 令牌
     * @return com.zhouyer.study.entity.ZhouyerUser
     * @author zhouyao
     */
    ZhouyerUser findByToken(@Param("token") String token);
}
